package com.company.module.net.bean;


import java.io.Serializable;

/**
 * @author sixbing
 * on 2018/4/24 0024 下午 3:02
 * description :
 */
public class BaseBean<T> implements Serializable {
    /**
     * "code": "",
     * "msg": "用户名/密码错误",
     * "obj": {},
     * "state": 1
     */
    public String code;
    public int state;
    public String msg;
    public T obj;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getMsg() {
        return msg == null ? "" : msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        if ("".equals(obj)) {
            return null;
        }
        return obj;
    }

    public void setData(T data) {
        if ("".equals(data)) {
            this.obj = null;
        } else {
            this.obj = data;
        }
    }

}
